package com.nervenets.template.hibernate.domain.common;

import com.nervenets.general.hibernate.DomainObject;
import com.nervenets.template.enumeration.UnionType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

@ApiModel("收藏表")
@Entity
@Table
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class Fav extends DomainObject {
    @ApiModelProperty(value = "关联类型")
    private UnionType type;
    @ApiModelProperty(value = "关联ID")
    private long unionId;

    ///
    @Transient
    private Object union;

    public Fav(UnionType type, long unionId) {
        this.type = type;
        this.unionId = unionId;
    }
}
